package com.llh.uua.model

import org.ktorm.entity.Entity
import org.ktorm.schema.Table
import org.ktorm.schema.boolean
import org.ktorm.schema.int
import org.ktorm.schema.varchar

/**
 *
 *
 * Created At 2021/3/17 21:29
 * @author llh
 */
interface SysUser : Entity<SysUser> {
    companion object : Entity.Factory<SysUser>()

    val id: Int
    var username: String
    var password: String
    var phoneNumber: String?
    var enabled: Boolean
}

object SysUsers : Table<SysUser>("sys_user") {
    val id = int("id").primaryKey().bindTo { it.id }
    val username = varchar("username").bindTo { it.username }
    val phoneNumber = varchar("phone_number").bindTo { it.phoneNumber }
    val password = varchar("password").bindTo { it.password }
    val enabled = boolean("enabled").bindTo { it.enabled }
}